Skip to content

fix: handle Windows backslash separators in isUnderMountPoint#7

Merged
mcollina merged 1 commit intoplatformatic:mainfrom
collinstevens:fix/windows-path-separator
Apr 20, 2026
Merged

fix: handle Windows backslash separators in isUnderMountPoint#7
mcollina merged 1 commit intoplatformatic:mainfrom
collinstevens:fix/windows-path-separator

Conversation

@collinstevens
Copy link
Copy Markdown
Contributor

@collinstevens collinstevens commented Apr 1, 2026

isUnderMountPoint hardcodes / as the path separator. On Windows, normalizeVFSPath produces backslashes via path.normalize, so paths like C:\foo\mount\file.js never match mount point C:\foo\mount. This causes shouldHandle to return false and readFileSync to throw ENOENT for every path under a Windows mount point.

The fix checks for both / and \ at the mount point boundary instead of hardcoding /.

isUnderMountPoint hardcoded / as the path separator, so Windows paths
produced by path.normalize (which uses \) never matched their mount
point. Check for both / and \ after the mount-point prefix, and handle
roots that already end with a separator (e.g. C:\ or /).
@collinstevens collinstevens marked this pull request as ready for review April 1, 2026 10:58
Copy link
Copy Markdown
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@mcollina mcollina merged commit 2a4ea7d into platformatic:main Apr 20, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants